import request from '@/utils/request'

// 查询预制菜品类管理列表
export function listFood(query) {
  return request({
    url: '/system/food/list',
    method: 'get',
    params: query
  })
}

// 查询预制菜品类管理详细
export function getFood(premaidFoodId) {
  return request({
    url: '/system/food/' + premaidFoodId,
    method: 'get'
  })
}

// 新增预制菜品类管理
export function addFood(data) {
  return request({
    url: '/system/food',
    method: 'post',
    data: data
  })
}

// 修改预制菜品类管理
export function updateFood(data) {
  return request({
    url: '/system/food',
    method: 'put',
    data: data
  })
}

// 删除预制菜品类管理
export function delFood(premaidFoodId) {
  return request({
    url: '/system/food/' + premaidFoodId,
    method: 'delete'
  })
}
//上下架
export function top(premaidFoodIds) {
  return request({
    url: '/system/food/top',
    method: 'put',
    params: {
          premaidFoodIds: premaidFoodIds.join(',')
    }
  })
}
